package my.jwds.p58;

public class LengthOfLastWord {
    public static void main(String[] args) {
        LengthOfLastWord o =new LengthOfLastWord();
        System.out.println(o.lengthOfLastWord("i am you  "));
    }


    public int lengthOfLastWord(String s) {
        s = s.trim();
        return s.length() - s.lastIndexOf(' ') - 1;
    }
}
